
int main()
{
    int n = 0;
    cin >> n;
    for (int i = 0;i < n;++i)
    {
        int num = 0;
        cin >> num;
        vector<string> v_str(num);
        for (int j = 0;j < num;++j)
        {
            cin >> v_str[j];
        }
        int left = 0;
        int right = num - 1;
        bool judge = true;
        while (left < right)
        {
            bool flag = false;
            unordered_map<char, int> hashtable;
            string str_left = v_str[left];
            string str_right = v_str[right];
            for (int k = 0;k < str_left.length();++k)
            {
                hashtable[str_left[k]]++;
            }
            for (int k = 0;k < str_right.length();++k)
            {
                if (hashtable.count(str_right[k]))
                {
                    flag = true;
                    break;
                }
            }
            if (!flag) {
                judge = false;
                break;
            }
            ++left, --right;
        }
        if(judge)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
    return 0;
}